import config from "@/config"
import http from "@/utils/request"

export default {
	pager: {
		url: `${config.API_URL}/admin/v1/clientele/pager`,
		name: "分页列表",
		get: function (params) {
			return http.get(this.url, params);
		}
	},
	create: {
		url: `${config.API_URL}/admin/v1/clientele/create`,
		name: "新增客户",
		post: function (data) {
			return http.post(this.url, data);
		}
	},
	detail: {
		url: `${config.API_URL}/admin/v1/clientele/:serial/detail`,
		name: "客户详情",
		get: function (serial) {
			const uri = this.url.replace(':serial', serial);
			return http.get(uri);
		},
		delete: function (serial) {
			const uri = this.url.replace(':serial', serial);
			return http.delete(uri);
		}
	},
	list: {
		url: `${config.API_URL}/admin/v1/clientele/list`,
		name: "客户列表",
		get: function () {
			return http.get(this.url);
		}
	}
}
